import requests
from bs4 import BeautifulSoup

url='https://www.lgfdcw.com/cs/'

h={
'user-agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/85.0.4183.102 Safari/537.36'
}


r = requests.get(url, headers=h)
# 将数据写入文件
with open('longgang.html', 'w', encoding='gbk') as f:
    f.write(r.content.decode('gbk'))


soup = BeautifulSoup(r.content.decode('gbk'),'lxml')
result1=soup.find_all('tr',{'bgcolor':"#FFFFFF"})
print(result1)
